package cn.kgc.tangcco.controller;

import cn.hutool.http.server.HttpServerRequest;
import cn.hutool.http.server.HttpServerResponse;
import cn.kgc.tangcco.utils.servlet.BaseServlet;

import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * @author 李昊哲
 * @Description
 * @create 2020/10/13 下午3:56
 */
@WebServlet(urlPatterns = "/person.action")
public class PersonAction extends BaseServlet {
    private static final long serialVersionUID = 4923567125307296706L;

    /**
     * get方式提交表单登录
     * @param request
     * @param response
     */
    public void loginWithFormByGet(HttpServletRequest request, HttpServletResponse response){
        String mobile = request.getParameter("mobile");
        String password = request.getParameter("password");
        System.out.println("mobile = " + mobile);
        System.out.println("password = " + password);
    }
    /**
     * post方式提交表单登录
     * @param request
     * @param response
     */
    public void loginWithFormByPost(HttpServletRequest request, HttpServletResponse response){
        String mobile = request.getParameter("mobile");
        String password = request.getParameter("password");
        System.out.println("mobile = " + mobile);
        System.out.println("password = " + password);
    }
    /**
     * post方式提交表单登录
     * @param request
     * @param response
     */
    public void addWithFormByPut(HttpServletRequest request, HttpServletResponse response){
        // application/x-www-form-urlencoded
        String mobile = request.getParameter("mobile");
        String password = request.getParameter("password");
        System.out.println("mobile = " + mobile);
        System.out.println("password = " + password);
    }
    /**
     * post方式提交表单登录
     * @param request
     * @param response
     */
    public void deleteWithFormBydelete(HttpServletRequest request, HttpServletResponse response){
        String mobile = request.getParameter("mobile");
        System.out.println("mobile = " + mobile);
    }
}
